package com.neno.producer.object;

import com.neno.entity.User;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: root
 * @Date: 2018/11/10 5:24
 */
@Component
public class ObjectProducer {
    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void sender(User user) {
        System.out.println("Sender object: " + user.toString());
        this.rabbitTemplate.convertAndSend("objectQuene", user);
    }
}
